<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员页面</title>
    <style>
        /* CSS 样式 */
        body {
            margin: 0;
            font-family: Arial, sans-serif;
        }

        .admin-container {
            display: flex;
            height: 100vh;
        }

        .sidebar {
            width: 200px;
            background-color: #333; /* 侧边栏背景颜色 */
            padding: 20px;
            color: white; /* 侧边栏文字颜色 */
        }

        .sidebar .username {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
            text-align: center;
        }

        .sidebar ul {
            list-style-type: none;
            padding: 0;
        }

        .sidebar ul li {
            margin: 15px 0;
        }

        .sidebar ul li a {
            text-decoration: none;
            color: white; /* 链接文字颜色 */
            font-size: 16px;
            display: block;
            padding: 10px;
            border-radius: 4px;
            transition: background-color 0.3s;
        }

        .sidebar ul li a:hover {
            background-color: #444; /* 鼠标悬停背景颜色 */
        }

        .sidebar ul li a.active {
            background-color: #007bff; /* 激活链接背景颜色 */
            color: white;
        }

        .main-content {
            flex: 1;
            background-color: #f4f4f4;
        }

        iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
    </style>
</head>
<body>
    <div class="admin-container">
        <!-- 左边侧边栏 -->
        <div class="sidebar">
            <!-- 管理员名字 -->
            <div class="username">管理员: admin</div>
            <ul>
                <li><a href="content-management.html" target="content-frame" class="active">内容管理</a></li>
                <li><a href="user-management.html" target="content-frame">用户管理</a></li>
                <li><a href="system-management.html" target="content-frame">系统配置</a></li>
                <li><a href="data-management.html" target="content-frame">数据管理</a></li>
            </ul>
        </div>

        <!-- 右边内容区域 -->
        <div class="main-content">
            <iframe name="content-frame" src="content-management.html"></iframe>
        </div>
    </div>

    <script>
        // JavaScript 逻辑
        document.addEventListener('DOMContentLoaded', function() {
            const links = document.querySelectorAll('.sidebar ul li a');

            links.forEach(link => {
                link.addEventListener('click', function() {
                    // 移除所有链接的 active 类
                    links.forEach(l => l.classList.remove('active'));
                    // 添加 active 类到当前点击的链接
                    this.classList.add('active');
                });
            });
        });
    </script>
</body>
</html>